#define _CRT_SECURE_NO_WARNINGS 1
#include"SList.h"


void TestSList1()
{
	SListNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	SListPushBack(&plist, 5);
	SListPushBack(&plist, 6);
	SListPrint(plist);
}

void TestSList2()
{
	SListNode* plist = NULL;
	SListPushFront(&plist, 1);
	SListPushFront(&plist, 2);
	SListPushFront(&plist, 3);
	SListPushFront(&plist, 4);
	SListPushFront(&plist, 5);
	SListPushFront(&plist, 6);
	SListPrint(plist);
	SListPopBack(&plist);
	SListPrint(plist);
	SListPopFront(&plist);
	SListPrint(plist);
}

void TestSList3()
{
	SListNode* plist = NULL;
	SListPushFront(&plist, 1);
	SListPushFront(&plist, 2);
	SListPushFront(&plist, 3);
	SListPushFront(&plist, 4);
	SListPushFront(&plist, 5);
	SListPushFront(&plist, 6);
	SListPrint(plist);
	SListNode* ret = SListFind(plist, 2);
	SListInsertAfter(ret, 20);
	SListPrint(plist);
	SListEraseAfter(ret);
	SListPrint(plist);

}

void TestSList4()
{
	SListNode* plist = NULL;
	SListPushFront(&plist, 1);
	/*SListPushFront(&plist, 2);
	SListPushFront(&plist, 3);
	SListPushFront(&plist, 4);
	SListPushFront(&plist, 5);
	SListPushFront(&plist, 6);*/
	SListPrint(plist);
	SListNode* ret = SListFind(plist, 1);
	SListInsert(&plist, ret, 30);
	SListPrint(plist);
	SListErase(&plist, ret);
	SListPrint(plist);
}


int main()
{
	TestSList4();
	return 0;
}
